﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddOrder.aspx.cs" Inherits="ZX.WebApp.Crm.Sale.AddOrder" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/calendar/assets/skins/sam/calendar.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/calendar/calendar-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/CombinButton.js" type="text/javascript"></script>
    <script src="../../Scripts/extend.validate.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.calendar.js" type="text/javascript"></script>
    <link href="../../Styles/default/calendar.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/base.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/extendTable.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #yui-dt22-th-Caption-liner span, #yui-dt22-th-UnitId-liner span, #yui-dt22-th-Amount-liner span, 
        #yui-dt22-th-UnitType-liner span, #yui-dt22-th-Rebate-liner span, #yui-dt22-th-RebateMoney-liner span,#yui-dt22-th-AccountReceivable-liner span, 
        #yui-dt22-th-ProductPrice-liner span,#yui-dt22-th-DeliverySum-liner span,#yui-dt22-th-LastFactDate-liner span,#yui-dt22-th-ResignMoney-liner span
        {
            color: Red;
        }
        #yui-dt22-th-RegisnAmount-liner span
        {
            color: Green;
        }
    </style>
</head>
<script src="../../Scripts/Appjs/model.AddOrder.Extend.js" type="text/javascript"></script>
<body class="yui-skin-sam" onkeydown="PreventBSK()">
    <form id="form1" runat="server">
    <div>
        <div id="toolbar" style="margin-top: 12px; text-align: center;">
            <button type="button" id="btnOK" name="btnAgree">
                知道了</button>&nbsp;&nbsp;
            <button type="button" id="btnAgree" name="btnAgree">
                提交</button>&nbsp;&nbsp;
            <button type="button" id="btnUnAgree" name="btnUnAgree">
                退回</button>
            <button type="button" id="btnSave" name="btnSave">
                保存</button>
            <button type="button" id="btnPay" name="btnPay">
                转缴款单</button>&nbsp;&nbsp;
            <button type="button" id="btnClose" name="btnClose">
                取消</button>
        </div>
        <div class="fieldForm" id="fieldForm">
            <div id="content">
                <h3>
                    客户基本信息</h3>
                <table class="table1">
                    <tr>
                        <th>
                            <span style="color: Red;">*</span><span>单号</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="Code" name="Code" readonly="readonly" class="width60" />
                        </td>
                        <td colspan="2">
                            &nbsp;
                        </td>
                        <th>
                            <span style="color: Red;">*</span><span>订单日期</span>
                        </th>
                        <td>
                            <input runat="server" type="text" id="Date" readonly="readonly" name="Date" class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th width="10%">
                            <span style="color: Red">*</span><span>客户名称</span>
                        </th>
                        <td width="23%">
                            <input type="hidden" id="CustomerID" name="CustomerID" runat="server" />
                            <input type="text" id="CustomerName" runat="server" name="CustomerName" readonly="readonly"
                                class="width60" />
                            <button id="btnCustomerID" name="F" type="button" runat="server" class="btnCheck"
                                style="height: 25px;">
                                选择</button>
                        </td>
                        <th width="10%">
                            <span>客户编码</span>
                        </th>
                        <td width="23%">
                            <input type="text" id="txtCustomerIDs" name="txtCustomerIDs" readonly="readonly"
                                class="width60" runat="server" />
                        </td>
                        <th width="10%">
                            <span>客户类型</span>
                        </th>
                        <td width="23%">
                            <input type="text" id="CustomerType" runat="server" name="CustomerType" readonly="readonly"
                                class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th width="10%">
                            <span>员工人数</span>
                        </th>
                        <td>
                            <input type="text" id="PersonId" name="PersonId" runat="server" readonly="readonly"
                                class="width60" />
                        </td>
                        <th width="10%">
                            <span>所属行业</span>
                        </th>
                        <td>
                            <input type="text" id="TradeId" name="TradeId" runat="server" readonly="readonly"
                                class="width60" />
                        </td>
                        <th width="10%">
                            <span>成立日期</span>
                        </th>
                        <td>
                            <input type="text" id="CreateDate" name="CreateDate" runat="server" readonly="readonly"
                                class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th width="10%">
                            <span>公司产品</span>
                        </th>
                        <td>
                            <input type="text" id="CompanyProduct" name="CompanyProduct" runat="server" readonly="readonly"
                                class="width60" />
                        </td>
                        <th width="10%">
                            <span>行销顾问</span>
                        </th>
                        <td>
                            <input type="text" id="SaleadName" runat="server" class="width60" readonly="readonly" />
                        </td>
                        <th width="10%">
                            <span>信息专员</span>
                        </th>
                        <td>
                            <input type="text" id="AddUserName" runat="server" class="width60" readonly="readonly" />
                        </td>
                    </tr>
                </table>
                <h3>
                    订单信息</h3>
                <table class="table1">
                    <tr>
                        <th width="10%">
                            <span style="color: Red">*</span><span>业绩归属</span>
                        </th>
                        <td width="23%">
                            <input type="hidden" id="DeptId" name="DeptId" runat="server" />
                            <input id="txtDeptId" name="txtDeptId" runat="server" readonly="readonly" type="text"
                                class="width60" />
                            <button id="btnDeptId" name="7" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th width="10%">
                            <span id="spanPaymentId" style="color: Red">*</span><span>付款方式</span>
                        </th>
                        <td width="23%">
                            <asp:DropDownList ID="PaymentId" name="PaymentId" runat="server" CssClass="width65"
                                AppendDataBoundItems="true">
                                <asp:ListItem Value=""> </asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <th width="10%">
                            <span style="color: Red">*</span><span>订单状态</span>
                        </th>
                        <td width="23%">
                            <asp:DropDownList ID="StateID" name="StateID" runat="server" CssClass="width65">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th width="10%">
                            <span style="color: Red">*</span><span>销售渠道</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="TypeID" name="TypeID" runat="server" CssClass="width65" AppendDataBoundItems="true">
                                <asp:ListItem Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <th width="10%">
                            <span>币别</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="ValutaID" name="ValutaID" runat="server" CssClass="width65">
                            </asp:DropDownList>
                        </td>
                        <th width="10%">
                            <span>产品包</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="ProductPackID" runat="server" CssClass="width65" AppendDataBoundItems="true">
                                <asp:ListItem Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td style="display: none;">
                            <span>是否价值业绩</span>
                        </td>
                        <td style="display: none;">
                            <asp:DropDownList ID="IsPerformance" runat="server" Width="140" AppendDataBoundItems="true">
                                <asp:ListItem Value="0">否</asp:ListItem>
                                <asp:ListItem Value="1">是</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th width="10%">
                            <span id="CourseLoyoutIDSpan" style="color: Red">*</span><span>课程成交期数</span>
                        </th>
                        <td>
                            <input type="hidden" id="CourseLoyoutID" runat="server" />
                            <input type="text" runat="server" id="txtCourseLoyoutID" readonly="readonly" class="width60" />
                            <button id="btnCourseLoyoutID" name="K" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th width="10%">
                            <span>日期</span>
                        </th>
                        <td>
                            <input type="text" id="OrderDate" name="OrderDate" class="width60" readonly="readonly" />
                        </td>
                        <th width="10%">
                            <span>地点</span>
                        </th>
                        <td>
                            <input type="text" id="OrderAddress" name="OrderAddress" class="width60" readonly="readonly" />
                        </td>
                    </tr>
                    <tr id="trDisplay1">
                        <th width="10%">
                            <span id="spanCustomerZJ" style="color: Red">*</span><span>签单人</span>
                        </th>
                        <td>
                            <input type="hidden" id="CustomerZJ" runat="server" />
                            <input type="text" id="txtCustomerZJ" name="txtCustomerZJ" readonly="readonly" class="width60"
                                runat="server" />
                            <button id="btnCustomerZJ" name="btnCustomerZJ" onclick="return CustomerZJClick()"
                                type="button" runat="server" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th width="10%">
                            <span>辅导员</span>
                        </th>
                        <td>
                            <input type="hidden" id="CustomerFD" runat="server" />
                            <input type="text" id="txtCustomerFD" name="txtCustomerFD" readonly="readonly" class="width60"
                                runat="server" />
                            <button id="btnCustomerFD" name="Z" type="button" runat="server" class="btnCheck"
                                style="height: 25px;">
                                选择</button>
                        </td>
                        <th width="10%">
                           <span id="span2" style="color: Red">*</span><span>课中服务人</span>
                        </th>
                        <td>
                            <input type="hidden" id="CustomerServer" runat="server" />
                            <input type="text" id="txtCustomerServer" name="txtCustomerServer" readonly="readonly"
                                class="width60" runat="server" />
                            <button id="btnCustomerServer" name="Z" type="button" runat="server" class="btnCheck"
                                style="height: 25px;">
                                选择</button>
                        </td>
                    </tr>
                    <tr id="trDisplay2">
                        <th width="10%">
                            <span id="spCustomerQD" style="color: Red">*</span><span>客户总监</span>
                        </th>
                        <td>
                            <input type="hidden" id="CustomerQD" runat="server" />
                            <input type="text" id="txtCustomerQD" name="txtCustomerQD" readonly="readonly" class="width60"
                                runat="server" />
                            <button id="btnCustomerQD" name="Z" type="button" runat="server" class="btnCheck"
                                style="height: 25px;">
                                选择</button>
                        </td>
                        <th width="10%">
                            <span id="spCustomerFZ" style="color: Red">*</span><span>分总</span>
                        </th>
                        <td>
                            <input type="hidden" id="CustomerFZ" runat="server" />
                            <input type="text" id="txtCustomerFZ" name="txtCustomerFZ" readonly="readonly" class="width60"
                                runat="server" />
                            <button id="btnCustomerFZ" name="Z" class="btnCheck" type="button" runat="server"
                                style="height: 25px;">
                                选择</button>
                        </td>
                        <td class="hideHeSuan" colspan="2" style="display: none;">
                            &nbsp;
                        </td>
                        <th class="showHeSuan" width="10%">
                            <span id="spCustomerHS" style="color: Red">*</span><span>核算人员</span>
                        </th>
                        <td class="showHeSuan">
                            <input type="hidden" id="CustomId" runat="server" name="CustomId" />
                            <input id="txtCustomId" runat="server" readonly="readonly" name="txtCustomId" type="text"
                                class="width60" />
                            <button id="btnCustomId" name="Z" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                    </tr>
                    <tr class="zsTr">
                        <th>
                            <span style="color: Red">*</span><span>赠送类型</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="PresentationType" name="PresentationType" runat="server" CssClass="width65"
                                AppendDataBoundItems="true">
                                <asp:ListItem Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <th>
                            <span style="color: Red;" id="zxId">*</span><span>关联订单号</span>
                        </th>
                        <td>
                            <input type="hidden" id="PresentationOrderId" runat="server" />
                            <input type="text" id="txtPresentationOrderId" name="txtPresentationOrderId" readonly="readonly"
                                class="width60" runat="server" />
                            <button id="btnPresentationOrderId" name="14" class="btnCheck" type="button" runat="server"
                                style="height: 25px;">
                                选择</button>
                        </td>
                        <td colspan="2">
                            &nbsp;
                        </td>
                    </tr>
                    <tr class="zsTr">
                        <th>
                            <span style="color: Red;" id="Span1">*</span><span>赠送原因</span>
                        </th>
                        <td colspan="5">
                            <input type="text" id="PresentationReason" name="PresentationReason" class="width60"
                                runat="server" />
                        </td>
                    </tr>
                    <tr class="tr1">
                        <th width="10%">
                            <span>备注</span>
                        </th>
                        <td colspan="5">
                            <textarea runat="server" id="Explain" name="Explain" style="width: 60%; height: 60px;"></textarea>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="extendDiv">
                <div id="con_two_1">
                    <h3>
                        产品信息
                        <button type="button" id="btnNew1" name="btnNew1">
                            新增</button>
                        <button type="button" id="btnDelete1" name="btnDelete1">
                            删除</button>
                    </h3>
                    <div id="con_1">
                    </div>
                </div>
                <div class="TotalMoneyDiv">
                <span style="color: Red;">合同总金额</span>
                <input id="htTotal" style="width: 70px;" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" type="text" />
                    <span>总折扣率</span>
                    <input type="text" runat="server" id="TotalRebate" name="TotalRebate" onkeyup="if(isNaN(value))execCommand('undo')"
                        onchange="TotalRebateChange(this.value)" onafterpaste="if(isNaN(value))execCommand('undo')"
                        style="width: 70px;" />
                    <span style="color: Red;">应收总金额</span>
                    <input type="text" runat="server" onchange="ht()" id="TotalMoney" name="TotalMoney" 
                        onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"
                        style="width: 70px;" />
                    <span style="color: Red;">已收总金额</span>
                    <input id="ysTotal" style="width: 70px;" readonly="readonly" type="text" />
                
                </div>
            </div>
        </div>
        <div id="dialog1" class="yui-pe-content">
            <div class="hd">
                信息选择</div>
            <div class="bd">
                <iframe id="EditUIWindow1" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
        <div id="dialog2" class="yui-pe-content">
            <div class="hd">
                信息选择</div>
            <div class="bd">
                <iframe id="EditUIWindow2" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
        <div id="dialog3" class="yui-pe-content">
            <div class="hd">
                信息选择</div>
            <div class="bd">
                <iframe id="EditUIWindow3" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
        <div id="dialog4" class="yui-pe-content">
            <div class="hd">
                退回原因</div>
            <div class="bd">
                <textarea id="txtReturn" name="txtReturn" style="width: 98%; height: 95%;"></textarea>
            </div>
        </div>
        <asp:HiddenField ID="ID" runat="server" />
        <input type="hidden" id="WorkFlowInsId" runat="server" />
        <input type="hidden" id="WorkTaskInsId" runat="server" />
        <input type="hidden" id="NameList" runat="server" />
        <input type="hidden" id="CustomerMrgList" runat="server" />
        <input type="hidden" id="DialogState" runat="server" />
    </div>
    </form>
    <form id="form2" style="display: none" action="../../Extend/AjaxData/CustomOperating.aspx">
    <textarea style="display: none" id="jsonDataContent" rows="2" cols="2" name="jsonDataContent"></textarea>
    </form>
</body>
<script type="text/javascript">
    var Url = "../../Extend/AjaxData/CustomOperating.aspx";
    var flag = "<%=Flag %>",entity = "<% =EntityName %>",uname="<%=UName %>",strOrderType="<%=OrderType %>",
        action = "<% =DataAction %>",view="<%=strView %>",OperStatus="<%=strOperStatus %>",
        WorkFlowId="<%=strWorkFlowId %>",
        WorkTaskId="<%=strWorkTaskId %>",
        OperatorInstanceId="<%=strOperatorInstanceId %>",
        WorkflowInsId="<%=strWorkflowInsId %>",
        WorkTaskInsId="<%=strWorkTaskInsId %>",
        Title="<%=PageTitle %>",
        Descript = "<%=strDescript %>";
    var CrmProduct=[<%=ListCrmProduct %>],
        CrmProductType=[<%=ListProductType %>],
        CrmListUnitId=[<%=ListUnitId %>],
        CrmOrderProdcut=[<%=ListOrderProduct %>],
        CrmState=[<%=ListState %>];
    var getTsid=$("#WorkTaskInsId").val();
    var myDataSource1, mDataTable1;
    var btnSave = "", btnClose = "",btnPay="",btnOK="",
        btnNews1 = "", btnDeletes1 = "", btnSaves1 = "",
        condition = "",btnAgree="",btnUnAgree="";
    var orderType=0;
    <asp:Literal ID="EditTemplate" runat="server"></asp:Literal>

    (function () {
        $(".zsTr").css("display","none");
        orderType=getPar1("orderType");
        $("#Date").cld();
        $("#TypeID>option:eq(1)").remove(); //去掉类型为约场

        $("#PaymentId").get(0).selectedIndex = 1;

        //debugger
        if(Descript=="lsdd"){ //历史订单
            orderType=2;
        }
        if(flag!="2"){
            if(Title=="新增一推订单"){
                $("#TypeID").get(0).selectedIndex = 1;
                $('#TypeID').attr("disabled","true");
            }else{
                if(Title=="新增赠送订单"){
                    orderType=1;
                    $("#spanPaymentId").hide();//付款方式
                    $("#spanCustomerZJ").hide();//签单人
                    $(".hideHeSuan").css("display","block");
                    $(".showHeSuan").css("display","none");
                    $("#TotalRebate").attr("readonly", "readonly");
                    $(".zsTr").show();
                }else if(Title=="新增历史订单"){
                    orderType=2;
                }else{
                    if(flag=="0"){
                        $("#TypeID>option:eq(1)").remove();  //去掉类型为一推
                    }
                }
            }
        }
        if(flag=="0"){ //新增
            $('#StateID').attr("disabled","true");
        }
        if(flag=="2"){ //修改
            $(".zsTr").hide();
            if(orderType==1){
                $("#spanPaymentId").hide();//付款方式
                $("#spanCustomerZJ").hide();//签单人
                $(".hideHeSuan").css("display","block");
                $(".showHeSuan").css("display","none");
            }
            if(Title=="销售订单修改"){
                $("#TypeID>option:eq(1)").remove();  //去掉类型为一推    
            }else if(Title=="一推订单修改"){
                $('#TypeID').attr("disabled","true");
            }else if(Title=="赠送订单修改"){
                $("#TotalRebate").attr("readonly", "readonly");
                $(".zsTr").css("display","block");
            }
            //$('#ProductPackID').attr("disabled","true");
        }
        if(flag=="3" || flag=="1" || flag=="4"){ //变更|//流程审核查看
            if(Descript=="lsdd"){
                
            }else{
                if(orderType==1||Descript=="fz"||Descript=="ck"||view=="unDone"){
                    $("#spanPaymentId").hide();//付款方式
                    $("#spanCustomerZJ").hide();//签单人
                    $(".hideHeSuan").css("display","block");
                    $(".showHeSuan").css("display","none");

                    $(".zsTr").show();
                    $("#btnPresentationOrderId").hide();
                }
                if(view=="unDone"){
                    orderType=strOrderType;
                }
                GetCheckState();
            }
            
        }
        if(orderType=="2"){
            $('#CourseLoyoutIDSpan').css("display", "none");
            $('#spanCustomerZJ').css("display", "none");
            $('#span2').css("display", "none");
            $('#spCustomerQD').css("display", "none");
            $('#spCustomerFZ').css("display", "none");
            $('#spCustomerHS').css("display", "none");
            $("#btnCustomId").css("display", "none");
            $("#btnCustomerID").attr("name", "FQ");
        }
        if(uname!="admin" && flag!="0" && flag!="4"){
            //$("#StateID>option:eq(0)").remove();//去掉新建订单状态
            //$("#StateID>option:eq(4)").remove();//去掉结案订单状态
        }
        if(Descript=="ck"){
            var Dom = YAHOO.util.Dom,
                Event = YAHOO.util.Event;
            Event.onDOMReady(function () {
                var layout = new YAHOO.widget.Layout({
                    units: [
                        { position: 'center', body: 'fieldForm', gutter: '0 1 1 1', scroll: true }
                    ]
                });
                layout.render();
            });
            handleOK();//抄送,点击加载即提交流程
        }else{
            var Dom = YAHOO.util.Dom,
                Event = YAHOO.util.Event;
            Event.onDOMReady(function () {
                var layout = new YAHOO.widget.Layout({
                    units: [
                        { position: 'bottom', height: 50, body: 'toolbar', gutter: '1 1 1 1', scroll: null, zIndex: 2 },
                        { position: 'center', body: 'fieldForm', gutter: '0 1 1 1', scroll: true }
                    ]
                });
                layout.render();
            });
        }

    })();

    //查看状态设置
    function GetCheckState() {
        //debugger
        if (view == "unDone" && OperStatus == "1") {  //退回原点，允许修改信息
            var obj = document.getElementById("fieldForm"); //得到DIV对象
            var e = obj.getElementsByTagName("input"); //得到此DIV里的所有INPUT对象
            var s = obj.getElementsByTagName("select");
            for (var j = 0; j < s.length; j++) {
                if (s[j].id == "ProductPackID") { //退回后产品包不允许修改
                    //s[j].disabled = true;
                }
            }
        } else {
            $('#btnCustomerCode').css("display", "none");
            $('#btnDeptId').css("display", "none");
            $('#btnCustomerZJ').css("display", "none");
            $('#btnCustomerServer').css("display", "none");
            $('#btnCustomerFZ').css("display", "none");
            $('#btnCustomerQD').css("display", "none");
            $('#btnCustomerFD').css("display", "none");
            $('#btnCustomId').css("display", "none");
            $('#btnCourseLoyoutID').hide();
            var obj = document.getElementById("fieldForm"); //得到DIV对象
            var e = obj.getElementsByTagName("input"); //得到此DIV里的所有INPUT对象
            var s = obj.getElementsByTagName("select");
            var t = obj.getElementsByTagName("textarea");
            for (var i = 0; i < e.length; i++) {
                $("#" + e[i].id + "").attr("readonly", "readonly");
            }
            for (var j = 0; j < s.length; j++) {
                if (s[j].id != "StateID") {
                    s[j].disabled = true;
                } else {
                    if (flag == "3") {

                    } else {
                        $('#StateID').attr("disabled", "true");
                    }
                }
            }
            for (var k = 0; k < t.length; k++) {
                $("#" + t[k].id + "").attr("readonly", "readonly");
            }
        }
    }

    //关闭当前页
    var Close = function () {
        window.parent.$("#tabs").tabs('close', '<%=PageTitle %>');
    }

    var CustomerZJClick = function(){
        document.getElementById("EditUIWindow3").src = "AddOrderInfo.aspx?entity=&actioin="+action+"&id="+$("#ID").val();
        YAHOO.example.container.dialog3.show();
    }
</script>
</html>
